/*
Copyright 2014, KISSY v1.47
MIT Licensed
build time: Aug 28 13:16
*/
KISSY.add("dom/selector/parser",[],function(){var m={},p=KISSY,o=function(f){this.rules=[];p.mix(this,f);this.resetInput(this.input)};o.prototype={constructor:function(f){this.rules=[];p.mix(this,f);this.resetInput(this.input)},resetInput:function(f){p.mix(this,{input:f,matched:"",stateStack:[o.STATIC.INITIAL],match:"",text:"",firstLine:1,lineNumber:1,lastLine:1,firstColumn:1,lastColumn:1})},getCurrentRules:function(){var f=this.stateStack[this.stateStack.length-1],d=[],f=this.mapState(f);p.each(this.rules,
function(e){var g=e.state||e[3];g?p.inArray(f,g)&&d.push(e):f===o.STATIC.INITIAL&&d.push(e)});return d},pushState:function(f){this.stateStack.push(f)},popState:function(){return this.stateStack.pop()},getStateStack:function(){return this.stateStack},showDebugInfo:function(){var f=o.STATIC.DEBUG_CONTEXT_LIMIT,d=this.matched,e=this.match,g=this.input,d=d.slice(0,d.length-e.length),d=(d.length>f?"...":"")+d.slice(-f).replace(/\n/," "),e=e+g,e=e.slice(0,f)+(e.length>f?"...":"");return d+e+"\n"+Array(d.length+
1).join("-")+"^"},mapSymbol:function(f){var d=this.symbolMap;return!d?f:d[f]||(d[f]=++this.symbolId)},mapReverseSymbol:function(f){var d=this.symbolMap,e,g=this.reverseSymbolMap;if(!g&&d)for(e in g=this.reverseSymbolMap={},d)g[d[e]]=e;return g?g[f]:f},mapState:function(f){var d=this.stateMap;return!d?f:d[f]||(d[f]=++this.stateId)},lex:function(){var f=this.input,d,e,g,l=this.getCurrentRules();this.match=this.text="";if(!f)return this.mapSymbol(o.STATIC.END_TAG);for(d=0;d<l.length;d++){e=l[d];var q=
e.token||e[0];g=e.action||e[2]||void 0;if(e=f.match(e.regexp||e[1])){if(d=e[0].match(/\n.*/g))this.lineNumber+=d.length;p.mix(this,{firstLine:this.lastLine,lastLine:this.lineNumber+1,firstColumn:this.lastColumn,lastColumn:d?d[d.length-1].length-1:this.lastColumn+e[0].length});d=this.match=e[0];this.matches=e;this.text=d;this.matched+=d;g=g&&g.call(this);g=void 0===g?q:this.mapSymbol(g);this.input=f=f.slice(d.length);return g?g:this.lex()}}}};o.STATIC={INITIAL:"I",DEBUG_CONTEXT_LIMIT:20,END_TAG:"$EOF"};
var s=new o({rules:[[2,/^\[(?:[\t\r\n\f\x20]*)/,function(){this.text=KISSY.trim(this.text)}],[3,/^(?:[\t\r\n\f\x20]*)\]/,function(){this.text=KISSY.trim(this.text)}],[4,/^(?:[\t\r\n\f\x20]*)~=(?:[\t\r\n\f\x20]*)/,function(){this.text=KISSY.trim(this.text)}],[5,/^(?:[\t\r\n\f\x20]*)\|=(?:[\t\r\n\f\x20]*)/,function(){this.text=KISSY.trim(this.text)}],[6,/^(?:[\t\r\n\f\x20]*)\^=(?:[\t\r\n\f\x20]*)/,function(){this.text=KISSY.trim(this.text)}],[7,/^(?:[\t\r\n\f\x20]*)\$=(?:[\t\r\n\f\x20]*)/,function(){this.text=
KISSY.trim(this.text)}],[8,/^(?:[\t\r\n\f\x20]*)\*=(?:[\t\r\n\f\x20]*)/,function(){this.text=KISSY.trim(this.text)}],[9,/^(?:[\t\r\n\f\x20]*)\=(?:[\t\r\n\f\x20]*)/,function(){this.text=KISSY.trim(this.text)}],[10,/^(?:(?:[\w]|[^\x00-\xa0]|(?:\\[^\n\r\f0-9a-f]))(?:[\w\d-]|[^\x00-\xa0]|(?:\\[^\n\r\f0-9a-f]))*)\(/,function(){this.text=KISSY.trim(this.text).slice(0,-1);this.pushState("fn")}],[11,/^[^\)]*/,function(){this.popState()},["fn"]],[12,/^(?:[\t\r\n\f\x20]*)\)/,function(){this.text=KISSY.trim(this.text)}],
[13,/^:not\((?:[\t\r\n\f\x20]*)/,function(){this.text=KISSY.trim(this.text)}],[14,/^(?:(?:[\w]|[^\x00-\xa0]|(?:\\[^\n\r\f0-9a-f]))(?:[\w\d-]|[^\x00-\xa0]|(?:\\[^\n\r\f0-9a-f]))*)/,function(){this.text=this.yy.unEscape(this.text)}],[15,/^"(\\"|[^"])*"/,function(){this.text=this.yy.unEscapeStr(this.text)}],[15,/^'(\\'|[^'])*'/,function(){this.text=this.yy.unEscapeStr(this.text)}],[16,/^#(?:(?:[\w\d-]|[^\x00-\xa0]|(?:\\[^\n\r\f0-9a-f]))+)/,function(){this.text=this.yy.unEscape(this.text.slice(1))}],
[17,/^\.(?:(?:[\w]|[^\x00-\xa0]|(?:\\[^\n\r\f0-9a-f]))(?:[\w\d-]|[^\x00-\xa0]|(?:\\[^\n\r\f0-9a-f]))*)/,function(){this.text=this.yy.unEscape(this.text.slice(1))}],[18,/^(?:[\t\r\n\f\x20]*),(?:[\t\r\n\f\x20]*)/,function(){this.text=KISSY.trim(this.text)}],[19,/^::?/,0],[20,/^(?:[\t\r\n\f\x20]*)\+(?:[\t\r\n\f\x20]*)/,function(){this.text=KISSY.trim(this.text)}],[21,/^(?:[\t\r\n\f\x20]*)>(?:[\t\r\n\f\x20]*)/,function(){this.text=KISSY.trim(this.text)}],[22,/^(?:[\t\r\n\f\x20]*)~(?:[\t\r\n\f\x20]*)/,
function(){this.text=KISSY.trim(this.text)}],[23,/^\*/,0],[24,/^(?:[\t\r\n\f\x20]+)/,0],[25,/^./,0]]});m.lexer=s;s.symbolMap={$EOF:1,LEFT_BRACKET:2,RIGHT_BRACKET:3,INCLUDES:4,DASH_MATCH:5,PREFIX_MATCH:6,SUFFIX_MATCH:7,SUBSTRING_MATCH:8,ALL_MATCH:9,FUNCTION:10,PARAMETER:11,RIGHT_PARENTHESES:12,NOT:13,IDENT:14,STRING:15,HASH:16,CLASS:17,COMMA:18,COLON:19,PLUS:20,GREATER:21,TILDE:22,UNIVERSAL:23,S:24,INVALID:25,$START:26,selectors_group:27,selector:28,simple_selector_sequence:29,combinator:30,type_selector:31,
id_selector:32,class_selector:33,attrib_match:34,attrib:35,attrib_val:36,pseudo:37,negation:38,negation_arg:39,suffix_selector:40,suffix_selectors:41};m.productions=[[26,[27]],[27,[28],function(){return[this.$1]}],[27,[27,18,28],function(){this.$1.push(this.$3)}],[28,[29]],[28,[28,30,29],function(){this.$1.nextCombinator=this.$3.prevCombinator=this.$2;this.$3.order=(this.$1.order=this.$1.order||0)+1;this.$3.prev=this.$1;return this.$1.next=this.$3}],[30,[20]],[30,[21]],[30,[22]],[30,[24],function(){return" "}],
[31,[14],function(){return{t:"tag",value:this.$1}}],[31,[23],function(){return{t:"tag",value:this.$1}}],[32,[16],function(){return{t:"id",value:this.$1}}],[33,[17],function(){return{t:"cls",value:this.$1}}],[34,[6]],[34,[7]],[34,[8]],[34,[9]],[34,[4]],[34,[5]],[35,[2,14,3],function(){return{t:"attrib",value:{ident:this.$2}}}],[36,[14]],[36,[15]],[35,[2,14,34,36,3],function(){return{t:"attrib",value:{ident:this.$2,match:this.$3,value:this.$4}}}],[37,[19,10,11,12],function(){return{t:"pseudo",value:{fn:this.$2.toLowerCase(),
param:this.$3}}}],[37,[19,14],function(){return{t:"pseudo",value:{ident:this.$2.toLowerCase()}}}],[38,[13,39,12],function(){return{t:"pseudo",value:{fn:"not",param:this.$2}}}],[39,[31]],[39,[32]],[39,[33]],[39,[35]],[39,[37]],[40,[32]],[40,[33]],[40,[35]],[40,[37]],[40,[38]],[41,[40],function(){return[this.$1]}],[41,[41,40],function(){this.$1.push(this.$2)}],[29,[31]],[29,[41],function(){return{suffix:this.$1}}],[29,[31,41],function(){return{t:"tag",value:this.$1.value,suffix:this.$2}}]];m.table=
{gotos:{"0":{27:8,28:9,29:10,31:11,32:12,33:13,35:14,37:15,38:16,40:17,41:18},2:{31:20,32:21,33:22,35:23,37:24,39:25},9:{30:33},11:{32:12,33:13,35:14,37:15,38:16,40:17,41:34},18:{32:12,33:13,35:14,37:15,38:16,40:35},19:{34:43},28:{28:46,29:10,31:11,32:12,33:13,35:14,37:15,38:16,40:17,41:18},33:{29:47,31:11,32:12,33:13,35:14,37:15,38:16,40:17,41:18},34:{32:12,33:13,35:14,37:15,38:16,40:35},43:{36:50},46:{30:33}},action:{"0":{2:[1,0,1],13:[1,0,2],14:[1,0,3],16:[1,0,4],17:[1,0,5],19:[1,0,6],23:[1,0,
7]},1:{14:[1,0,19]},2:{2:[1,0,1],14:[1,0,3],16:[1,0,4],17:[1,0,5],19:[1,0,6],23:[1,0,7]},3:{1:[2,9,0],2:[2,9,0],12:[2,9,0],13:[2,9,0],16:[2,9,0],17:[2,9,0],18:[2,9,0],19:[2,9,0],20:[2,9,0],21:[2,9,0],22:[2,9,0],24:[2,9,0]},4:{1:[2,11,0],2:[2,11,0],12:[2,11,0],13:[2,11,0],16:[2,11,0],17:[2,11,0],18:[2,11,0],19:[2,11,0],20:[2,11,0],21:[2,11,0],22:[2,11,0],24:[2,11,0]},5:{1:[2,12,0],2:[2,12,0],12:[2,12,0],13:[2,12,0],16:[2,12,0],17:[2,12,0],18:[2,12,0],19:[2,12,0],20:[2,12,0],21:[2,12,0],22:[2,12,0],
24:[2,12,0]},6:{10:[1,0,26],14:[1,0,27]},7:{1:[2,10,0],2:[2,10,0],12:[2,10,0],13:[2,10,0],16:[2,10,0],17:[2,10,0],18:[2,10,0],19:[2,10,0],20:[2,10,0],21:[2,10,0],22:[2,10,0],24:[2,10,0]},8:{1:[0,0,0],18:[1,0,28]},9:{1:[2,1,0],18:[2,1,0],20:[1,0,29],21:[1,0,30],22:[1,0,31],24:[1,0,32]},10:{1:[2,3,0],18:[2,3,0],20:[2,3,0],21:[2,3,0],22:[2,3,0],24:[2,3,0]},11:{1:[2,38,0],2:[1,0,1],13:[1,0,2],16:[1,0,4],17:[1,0,5],18:[2,38,0],19:[1,0,6],20:[2,38,0],21:[2,38,0],22:[2,38,0],24:[2,38,0]},12:{1:[2,31,0],
2:[2,31,0],13:[2,31,0],16:[2,31,0],17:[2,31,0],18:[2,31,0],19:[2,31,0],20:[2,31,0],21:[2,31,0],22:[2,31,0],24:[2,31,0]},13:{1:[2,32,0],2:[2,32,0],13:[2,32,0],16:[2,32,0],17:[2,32,0],18:[2,32,0],19:[2,32,0],20:[2,32,0],21:[2,32,0],22:[2,32,0],24:[2,32,0]},14:{1:[2,33,0],2:[2,33,0],13:[2,33,0],16:[2,33,0],17:[2,33,0],18:[2,33,0],19:[2,33,0],20:[2,33,0],21:[2,33,0],22:[2,33,0],24:[2,33,0]},15:{1:[2,34,0],2:[2,34,0],13:[2,34,0],16:[2,34,0],17:[2,34,0],18:[2,34,0],19:[2,34,0],20:[2,34,0],21:[2,34,0],22:[2,
34,0],24:[2,34,0]},16:{1:[2,35,0],2:[2,35,0],13:[2,35,0],16:[2,35,0],17:[2,35,0],18:[2,35,0],19:[2,35,0],20:[2,35,0],21:[2,35,0],22:[2,35,0],24:[2,35,0]},17:{1:[2,36,0],2:[2,36,0],13:[2,36,0],16:[2,36,0],17:[2,36,0],18:[2,36,0],19:[2,36,0],20:[2,36,0],21:[2,36,0],22:[2,36,0],24:[2,36,0]},18:{1:[2,39,0],2:[1,0,1],13:[1,0,2],16:[1,0,4],17:[1,0,5],18:[2,39,0],19:[1,0,6],20:[2,39,0],21:[2,39,0],22:[2,39,0],24:[2,39,0]},19:{3:[1,0,36],4:[1,0,37],5:[1,0,38],6:[1,0,39],7:[1,0,40],8:[1,0,41],9:[1,0,42]},
20:{12:[2,26,0]},21:{12:[2,27,0]},22:{12:[2,28,0]},23:{12:[2,29,0]},24:{12:[2,30,0]},25:{12:[1,0,44]},26:{11:[1,0,45]},27:{1:[2,24,0],2:[2,24,0],12:[2,24,0],13:[2,24,0],16:[2,24,0],17:[2,24,0],18:[2,24,0],19:[2,24,0],20:[2,24,0],21:[2,24,0],22:[2,24,0],24:[2,24,0]},28:{2:[1,0,1],13:[1,0,2],14:[1,0,3],16:[1,0,4],17:[1,0,5],19:[1,0,6],23:[1,0,7]},29:{2:[2,5,0],13:[2,5,0],14:[2,5,0],16:[2,5,0],17:[2,5,0],19:[2,5,0],23:[2,5,0]},30:{2:[2,6,0],13:[2,6,0],14:[2,6,0],16:[2,6,0],17:[2,6,0],19:[2,6,0],23:[2,
6,0]},31:{2:[2,7,0],13:[2,7,0],14:[2,7,0],16:[2,7,0],17:[2,7,0],19:[2,7,0],23:[2,7,0]},32:{2:[2,8,0],13:[2,8,0],14:[2,8,0],16:[2,8,0],17:[2,8,0],19:[2,8,0],23:[2,8,0]},33:{2:[1,0,1],13:[1,0,2],14:[1,0,3],16:[1,0,4],17:[1,0,5],19:[1,0,6],23:[1,0,7]},34:{1:[2,40,0],2:[1,0,1],13:[1,0,2],16:[1,0,4],17:[1,0,5],18:[2,40,0],19:[1,0,6],20:[2,40,0],21:[2,40,0],22:[2,40,0],24:[2,40,0]},35:{1:[2,37,0],2:[2,37,0],13:[2,37,0],16:[2,37,0],17:[2,37,0],18:[2,37,0],19:[2,37,0],20:[2,37,0],21:[2,37,0],22:[2,37,0],
24:[2,37,0]},36:{1:[2,19,0],2:[2,19,0],12:[2,19,0],13:[2,19,0],16:[2,19,0],17:[2,19,0],18:[2,19,0],19:[2,19,0],20:[2,19,0],21:[2,19,0],22:[2,19,0],24:[2,19,0]},37:{14:[2,17,0],15:[2,17,0]},38:{14:[2,18,0],15:[2,18,0]},39:{14:[2,13,0],15:[2,13,0]},40:{14:[2,14,0],15:[2,14,0]},41:{14:[2,15,0],15:[2,15,0]},42:{14:[2,16,0],15:[2,16,0]},43:{14:[1,0,48],15:[1,0,49]},44:{1:[2,25,0],2:[2,25,0],13:[2,25,0],16:[2,25,0],17:[2,25,0],18:[2,25,0],19:[2,25,0],20:[2,25,0],21:[2,25,0],22:[2,25,0],24:[2,25,0]},45:{12:[1,
0,51]},46:{1:[2,2,0],18:[2,2,0],20:[1,0,29],21:[1,0,30],22:[1,0,31],24:[1,0,32]},47:{1:[2,4,0],18:[2,4,0],20:[2,4,0],21:[2,4,0],22:[2,4,0],24:[2,4,0]},48:{3:[2,20,0]},49:{3:[2,21,0]},50:{3:[1,0,52]},51:{1:[2,23,0],2:[2,23,0],12:[2,23,0],13:[2,23,0],16:[2,23,0],17:[2,23,0],18:[2,23,0],19:[2,23,0],20:[2,23,0],21:[2,23,0],22:[2,23,0],24:[2,23,0]},52:{1:[2,22,0],2:[2,22,0],12:[2,22,0],13:[2,22,0],16:[2,22,0],17:[2,22,0],18:[2,22,0],19:[2,22,0],20:[2,22,0],21:[2,22,0],22:[2,22,0],24:[2,22,0]}}};m.parse=
function(f){var d=this,e=d.lexer,g,l,q=d.table,o=q.gotos,q=q.action,m=d.productions,r=[null],i=[0];for(e.resetInput(f);;){f=i[i.length-1];g||(g=e.lex());if(!g)return!1;l=q[f]&&q[f][g];if(!l){var s=[];q[f]&&p.each(q[f],function(f,e){s.push(d.lexer.mapReverseSymbol(e))});e.showDebugInfo();s.join(", ");return!1}switch(l[0]){case 1:i.push(g);r.push(e.text);i.push(l[2]);g=null;break;case 2:var h=m[l[1]],f=h.symbol||h[0];l=h.action||h[2];var u=(h.rhs||h[1]).length,t=0,v,h=r[r.length-u];v=void 0;for(d.$$=
h;t<u;t++)d["$"+(u-t)]=r[r.length-1-t];l&&(v=l.call(d));h=void 0!==v?v:d.$$;u&&(i=i.slice(0,-2*u),r=r.slice(0,-1*u));i.push(f);r.push(h);i.push(o[i[i.length-2]][i[i.length-1]]);break;case 0:return h}}};return m});
KISSY.add("dom/selector",["./selector/parser","dom/basic"],function(m,p){function o(a){return a.replace(G,H)}function s(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}function f(a){var b=0,c=0;if("number"===typeof a)c=a;else if("odd"===a)b=2,c=1;else if("even"===a)b=2,c=0;else if(a=a.replace(/\s/g,"").match(I))a[1]?(b=parseInt(a[2]),isNaN(b)&&(b="-"===a[2]?-1:1)):b=0,c=parseInt(a[3])||0;return{a:b,b:c}}function d(a,b,c,d){if(0===b){if(a===c)return d}else if(0<=(a-c)/b&&0===(a-c)%b&&d)return 1}function e(a,
b){return i._selectInternal(a,null,b)}function g(a,b){if(!b)return!0;if(!a||9===a.nodeType)return!1;var c=1,d=b.suffix,f,e;"tag"===b.t&&(c&=C.tag(a,b.value));if(c&&d){f=d.length;for(e=0;c&&e<f;e++){var g=d[e],k=g.t;C[k]&&(c&=C[k](a,g.value))}}return c}function l(a,b){var c=1,d=a,f,e=b;do if(c&=g(a,b)){b=b&&b.prev;if(!b)return!0;f=A[b.nextCombinator];a=s(a,f.dir);if(!f.immediate)return{el:a,match:b}}else if(f=A[b.nextCombinator],f.immediate)break;else return{el:a&&s(a,f.dir),match:b};while(a);return{el:s(d,
A[e.nextCombinator].dir),match:e}}function q(a,b){var c;if(t){if(!(c=a.getAttribute(h)))a.setAttribute(h,c=+new Date+"_"+ ++v)}else if(!(c=a[h]))c=a[h]=+new Date+"_"+ ++v;c=c+"_"+(b.order||0);if(c in y)return y[c];y[c]=F(a,b);return y[c]}function F(a,b){var c=l(a,b);if(!0===c)return!0;a=c.el;for(b=c.match;a;){if(q(a,b))return!0;a=s(a,A[b.nextCombinator].dir)}return!1}function D(a,b,c){u[a]||(u[a]=r.parse(a));var a=u[a],d=0,f=a.length,e,w,k=[];c&&(b=b||c[0].ownerDocument);e=b&&b.ownerDocument||E;for(t=
(w=(b=b||e)&&(b.ownerDocument||b).documentElement)?"html"!==w.nodeName.toLowerCase():!1;d<f;d++){y={};w=a[d];var j=w.suffix,h,n,l,o=c;l=null;if(!o){if(j&&!t){h=0;for(n=j.length;h<n;h++){var m=j[h];if("id"===m.t){l=m.value;break}}}if(l)if(h=!b.getElementById,n=i._contains(e,b),j=h?n?e.getElementById(l):null:b.getElementById(l),!j&&h||j&&z(j,"id")!==l){h=i._getElementsByTagName("*",b);n=h.length;for(m=0;m<n;m++)if(j=h[m],z(j,"id")===l){o=[j];break}m===n&&(o=[])}else n&&j&&b!==e&&(j=i._contains(b,j)?
j:null),o=j?[j]:[];else o=i._getElementsByTagName(w.value||"*",b)}l=0;if(j=o.length)for(;l<j;l++){h=o[l];a:{n=h;var m=void 0,p=w;do{if(!g(n,p)){n=null;break a}p=p.prev;if(!p){n=!0;break a}m=A[p.nextCombinator];n=s(n,m.dir)}while(n&&m.immediate);n=!n?null:{el:n,match:p}}!0===n?k.push(h):n&&q(n.el,n.match)&&k.push(h)}}1<f&&(k=i.unique(k));return k}var r=p("./selector/parser"),i=p("dom/basic"),E=m.Env.host.document,h="_ks_data_selector_id_",u={},t,v=0,y={},z=function(a,b){return t?i._getSimpleAttr(a,
b):i.attr(a,b)},J=i._hasSingleClass,K=i._isTag,I=/^(([+-]?(?:\d+)?)?n)?([+-]?\d+)?$/,G=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,H=function(a,b){var c="0x"+b-65536;return isNaN(c)?b:0>c?String.fromCharCode(c+65536):String.fromCharCode(c>>10|55296,c&1023|56320)};r.lexer.yy={unEscape:o,unEscapeStr:function(a){return this.unEscape(a.slice(1,-1))}};var B={"nth-child":function(a,b){var c=f(b),e=c.a,c=c.b;if(0===e&&0===c)return 0;var g=0,h=a.parentNode;if(h)for(var h=h.childNodes,i=0,k,j=h.length;i<j;i++)if(k=
h[i],1===k.nodeType&&(g++,k=d(g,e,c,k===a),void 0!==k))return k;return 0},"nth-last-child":function(a,b){var c=f(b),e=c.a,c=c.b;if(0===e&&0===c)return 0;var h=0,g=a.parentNode;if(g)for(var g=g.childNodes,i=g.length-1,k;0<=i;i--)if(k=g[i],1===k.nodeType&&(h++,k=d(h,e,c,k===a),void 0!==k))return k;return 0},"nth-of-type":function(a,b){var c=f(b),e=c.a,c=c.b;if(0===e&&0===c)return 0;var g=0,h=a.parentNode;if(h)for(var h=h.childNodes,i=a.tagName,k=0,j,l=h.length;k<l;k++)if(j=h[k],j.tagName===i&&(g++,
j=d(g,e,c,j===a),void 0!==j))return j;return 0},"nth-last-of-type":function(a,b){var c=f(b),e=c.a,c=c.b;if(0===e&&0===c)return 0;var h=0,g=a.parentNode;if(g)for(var g=g.childNodes,i=a.tagName,k=g.length-1,j;0<=k;k--)if(j=g[k],j.tagName===i&&(h++,j=d(h,e,c,j===a),void 0!==j))return j;return 0},lang:function(a,b){var c,b=o(b.toLowerCase());do if(c=t?a.getAttribute("xml:lang")||a.getAttribute("lang"):a.lang)return c=c.toLowerCase(),c===b||0===c.indexOf(b+"-");while((a=a.parentNode)&&1===a.nodeType);
return!1},not:function(a,b){return!C[b.t](a,b.value)}},x={empty:function(a){for(var a=a.childNodes,b=0,c=a.length-1,d;b<c;b++)if(d=a[b],d=d.nodeType,1===d||3===d||4===d||5===d)return 0;return 1},root:function(a){return a.ownerDocument&&a===a.ownerDocument.documentElement},"first-child":function(a){return B["nth-child"](a,1)},"last-child":function(a){return B["nth-last-child"](a,1)},"first-of-type":function(a){return B["nth-of-type"](a,1)},"last-of-type":function(a){return B["nth-last-of-type"](a,
1)},"only-child":function(a){return x["first-child"](a)&&x["last-child"](a)},"only-of-type":function(a){return x["first-of-type"](a)&&x["last-of-type"](a)},focus:function(a){var b=a.ownerDocument;return b&&a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&!(!a.type&&!(a.href||0<=a.tabIndex))},target:function(a){var b=location.hash;return b&&b.slice(1)===z(a,"id")},enabled:function(a){return!a.disabled},disabled:function(a){return a.disabled},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===
b&&a.checked||"option"===b&&a.selected}},L={"~=":function(a,b){return!b||-1<b.indexOf(" ")?0:-1!==(" "+a+" ").indexOf(" "+b+" ")},"|=":function(a,b){return-1!==(" "+a).indexOf(" "+b+"-")},"^=":function(a,b){return b&&m.startsWith(a,b)},"$=":function(a,b){return b&&m.endsWith(a,b)},"*=":function(a,b){return b&&-1!==a.indexOf(b)},"=":function(a,b){return a===b}},C={tag:K,cls:J,id:function(a,b){return z(a,"id")===b},attrib:function(a,b){var c=b.ident;t||(c=c.toLowerCase());var c=z(a,c),d=b.match;if(!d&&
void 0!==c)return 1;if(d){if(void 0===c)return 0;if(d=L[d])return d(c+"",b.value+"")}return 0},pseudo:function(a,b){var c,d;if(d=b.fn){if(!(c=B[d]))throw new SyntaxError("Syntax error: not support pseudo: "+d);return c(a,b.param)}if(c=b.ident){if(!x[c])throw new SyntaxError("Syntax error: not support pseudo: "+c);return x[c](a)}return 0}},A={">":{dir:"parentNode",immediate:1}," ":{dir:"parentNode"},"+":{dir:"previousSibling",immediate:1},"~":{dir:"previousSibling"}};"sourceIndex"in E.documentElement&&
(i._compareNodeOrder=function(a,b){return a.sourceIndex-b.sourceIndex});i._matchesInternal=e;i._selectInternal=D;return{parse:function(a){return r.parse(a)},select:D,matches:e}});
